import java.util.GregorianCalendar;


/**
 * Represents a magazine
 * 
 * A magazine is lend and reserve able
 * 
 * Special information: Publisher, Publishing date
 */
public class Magazine extends LendReserveItem {
    private Publisher _publisher;
    private GregorianCalendar _publishingDate;

    /**
     * Constructor 
     * 
     * @param title Title of Magazine
     * @param publisher Publisher
     * @param publishingDate Date of publish
     * @param desc Description
     */
    public Magazine(String title, Publisher publisher, GregorianCalendar publishingDate, String desc) {
        super(title, desc);
        _publisher = publisher;
        _publishingDate = publishingDate;
    }
    
    /**
     * Specific getter's
     */
    public Publisher getPublisher() {
        return _publisher;
    }
    public GregorianCalendar getPublishingDate() {
        return _publishingDate;
    }
    
    @Override
    public String toString() {
        StringBuilder rv = new StringBuilder();
        rv.append("Magazine ");
        rv.append(super.toString());
        rv.append(", ");
        rv.append(_publisher);
        rv.append(", ");
        rv.append(_publishingDate);
        return rv.toString();
    }
    
}
